package cn.snowheart

/**
 * 异常处理
 *
 * @author liuwanxiang
 * @version 2019/05/31
 */
class ExceptionExample {

    static void main(String[] args) {
        method2()
        method1()
    }


    static void method1() throws Exception {
        int i = 10 / 0
    }

    static void method2() {
        try {
            int i = 10 / 0
        } catch (Exception e) {
            println "Exception has been ate"
        } finally {
            println "Finally Code"
        }
    }
}
